Quick Guide to Writing Silo Plugins - Beta SDK 0.1


-This plugin SDK is in beta form.  We'll be revising the architecture, adding increased access to functions and data, as the weeks go on.  Let us know on our user forums (www.silo3d.com/forum) which data items and which functions you feel you would need access to.


-You only need to edit UserPlugin.h and UserPlugin.cpp to make many plugins.  If you want to add more functionality to the provided classes, you can edit their respective header (.h) and source (.cpp) files.  Don't edit GeneralPlugin.h or GeneralPlugin.cpp.  You may also add your own class files.


-Look in the file PluginInterface.h to see what data and functions you have access to through the sceneData, sceneFunctions, and shapeFunctions members of the UserPlugin class.


-You can access every command in Silo by using sceneFunctions->ExecuteCommand(which) from within your UserPlugin class, where "which" is one of the command enumerations foud in Commands.h.   For example, to create a cube I would call sceneFunctions->ExecuteCommand(COM_ADD_CUBE);


-You enable callback functions (such as a function that gets called every time the left mouse button is clicked) by uncommenting their declaration in UserPlugin.h and implementing them in UserPlugin.cpp (see the sample functions plugin).


-When creating geometry (Shapes, Vertices, Edges, or Faces), use the AllocateVertex, AllocateEdge, etc commands in the UserPlugin's sceneFunctions member.  Don't use new and delete.  Allocation in this way will use Silo's built-in memory management and will take care of cleanup for you through the undo manager if you use the proper undo commands.


-Put the compiled dlls in your Plugins/Filetype Plugins or Plugins/Startup Plugins folder in your Silo install directory to have them automatically installed when you next startup Silo.  Look for function/tool plugins in the function lists where you assign shortcuts or buttons.  Import/export plugins will show their file extension in the file dialog when you save or load a scene.


-To compile the sample plugins, replace the UserPlugin.h and UserPlugin.cpp files in the outer directory with those in the sample folders.